home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue58 / Clinic / AppLauncherU.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-04-27  |  965 b   |  49 lines

  1. unit AppLauncherU;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, Buttons;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     edtCommand: TEdit;
  12.     SpeedButton1: TSpeedButton;
  13.     edtParams: TEdit;
  14.     Label1: TLabel;
  15.     Label2: TLabel;
  16.     btnLaunch: TButton;
  17.     OpenDialog: TOpenDialog;
  18.     procedure SpeedButton1Click(Sender: TObject);
  19.     procedure btnLaunchClick(Sender: TObject);
  20.   private
  21.     { Private declarations }
  22.   public
  23.     { Public declarations }
  24.   end;
  25.  
  26. var
  27.   Form1: TForm1;
  28.  
  29. implementation
  30.  
  31. uses RunCmd;
  32.  
  33. {$R *.DFM}
  34.  
  35. procedure TForm1.SpeedButton1Click(Sender: TObject);
  36. begin
  37.   OpenDialog.FileName := edtCommand.Text;
  38.   if OpenDialog.Execute then
  39.     edtCommand.Text := OpenDialog.FileName
  40. end;
  41.  
  42. procedure TForm1.btnLaunchClick(Sender: TObject);
  43. begin
  44.   RunCommand(edtCommand.Text, edtParams.Text,
  45.     Application.Minimize, Application.Restore)
  46. end;
  47.  
  48. end.
  49.